<?php
// +----------------------------------------------------------------------
// | Siteplus [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://www.brsttech.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Pillar <service@brsttech.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;
use think\Validate;

class User extends Validate{

    protected $rule = [
        'username'  =>  'require|alphaNum',
        'password'  =>  'require|min:6',
        'about'     =>  'require',
        'group_id'  =>  'require',
        'id'        =>  'require',
        '__token__' =>  'token'
    ];

    protected $message = [
        'username'  =>  '{%lang_user_username}',
        'password'  =>  '{%lang_user_password}',
        'group_id'  =>  '{%lang_user_group_id}',
        'id'        =>  '{%lang_user_id}',
        'about'     =>  '{%lang_user_about}',
        '__token__' =>  '{%lang_user_token}',
    ];

    protected $scene = [
        'login'    =>  ['username','password','__token__'],
        'password' =>  ['password','about'],
        'add'    =>  ['username','group_id','password','about'],
        'edit'   =>  ['id','group_id','password','about'],
    ];
}